<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFinanceScheduleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('finance_schedule', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('finance_id')->nullable()->index()->comment('财务数据ID');
            $table->unsignedTinyInteger('type')->default(1)->comment('款项类型 0:扣款 1:收款');
            $table->timestamp('time')->comment('款项时间');
            $table->integer('receipts')->comment('款项金额');
            $table->string('describe')->comment('款项说明（哪一单/金额）');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('finance_schedule');
    }
}
